Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dragging strings to new tab button #3228

Merged
merged 5 commits into from
Sep 12, 2024

Conversation

jotaemepereira
Copy link
Collaborator

@jotaemepereira jotaemepereira commented Sep 6, 2024

Task/Issue URL: https://app.asana.com/0/1201048563534612/1208209124965669/f
Tech Design URL:
CC:

Description:
This update adds support for dragging strings to the new tab button and the tab bar.

  • When a string is dropped to the new tab button, it opens a new tab with a search on the dropped string.
  • When a string is dropped to the current tab (both regular and pinned tabs), the tab gets replaced by a search for the dropped string.
  • When a string is dropped in the tab bar. For example, at the right of the + button when there is room, it should open a new search with the dropped string.

This request came from: #3189

dragging-strings.mov

Steps to test this PR:
Verify new tab is open with a DDG search when a string is dragged to the + button or the tab bar

  1. Drag some text (it could be from a website inside the browser, or any other app) to the new tab button or the tab bar
  2. Verify a new tab is open with the dragged text

Verify current tab is replaced with a DDG search when text is dragged to the tab (either regular or pinned tabs)

  1. Drag some text (it could be from a website inside the browser, or any other app) to a tab (either selected or not)
  2. Verify the tab is replaced with a DDG search with the dragged string
  3. If the tab was not selected it should now

Definition of Done:

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@jotaemepereira jotaemepereira requested review from ayoy, a team and amddg44 and removed request for ayoy and a team September 6, 2024 13:02
Copy link
Contributor

@amddg44 amddg44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the test steps worked exactly as described, nice work! 👏

I tested dragging images and links (just in case!) over existing tabs and noticed these resulted in searches populated with the image url / link url instead of loading the url - not sure what the expected behaviour is but it’s probably out of scope here!

Also just noting that dragging text over an existing tab causes that tab to lose its history (although pinned tabs do keep theirs); I couldn’t tell from the spec if that was the requirement or not 🙂

DragImages.mp4

@jotaemepereira
Copy link
Collaborator Author

All the test steps worked exactly as described, nice work! 👏

I tested dragging images and links (just in case!) over existing tabs and noticed these resulted in searches populated with the image url / link url instead of loading the url - not sure what the expected behaviour is but it’s probably out of scope here!

Also just noting that dragging text over an existing tab causes that tab to lose its history (although pinned tabs do keep theirs); I couldn’t tell from the spec if that was the requirement or not 🙂

DragImages.mp4

Great findings @amddg44 !!! I believe both things you described are bugs:

  • The history being lost after the tab gets updated with the dragged text
  • When dragging an image it searches for the image URL instead of loading the URL

I will address both of them. Thanks.

- Inserts new tab when string gets dropped in the tab bar
- Replaces current tab with string search when strings gets dropped on regular tab
- Fix URLs not being loaded correctly when dropping them into the tabs
@jotaemepereira jotaemepereira force-pushed the juan/allow-dragging-strings-to-new-tab-button branch from 2992c41 to 0a96e4b Compare September 12, 2024 17:30
@jotaemepereira jotaemepereira merged commit e5fd061 into main Sep 12, 2024
18 checks passed
@jotaemepereira jotaemepereira deleted the juan/allow-dragging-strings-to-new-tab-button branch September 12, 2024 17:46
samsymons added a commit that referenced this pull request Sep 12, 2024
# By Dominik Kapusta (4) and others
# Via Dominik Kapusta (4) and GitHub (2)
* main:
  Support dragging strings to new tab button (#3228)
  BSK - Add feature flag for SKAN API (#3265)
  Ignore accents when doing a bookmark search (#3255)
  Update UI tests workflows to always compile the app on the supported version of Xcode (#3262)
  Bump C.S.S (via BSK) (#3244)
  Tab previews presentation implementation adjusted for the latest MouseOverView logic (#3260)
  Bump version to 1.106.0 (260)
  Default to appstore signing for fastlane match
  Clean up secrets in GHA workflows
  Update Onboarding gradients (#3248)
  Wait for UserScripts to be loaded for email protection (#3252)
  Fix UI tests failing in the CI (#3254)
  Fix WKDownloadMock mock (#3258)
  VPN Proxy stop and pixel improvements (#3239)
  Use fastlane match for code signing DMG builds (#3246)
  Implement new VPN site troubleshooting report alert (#3224)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
samsymons added a commit that referenced this pull request Sep 13, 2024
# By Dominik Kapusta (7) and others
# Via Dominik Kapusta (6) and GitHub (4)
* main: (37 commits)
  Add visted links support (#3261)
  Bump version to 1.106.0 (261)
  Update Gemfile.lock
  Remove migration file (#3270)
  Use new AsanaCreateActionItem action (#3264)
  Update survey builder OS version (#3247)
  Support dragging strings to new tab button (#3228)
  BSK - Add feature flag for SKAN API (#3265)
  Ignore accents when doing a bookmark search (#3255)
  Update UI tests workflows to always compile the app on the supported version of Xcode (#3262)
  Bump C.S.S (via BSK) (#3244)
  Tab previews presentation implementation adjusted for the latest MouseOverView logic (#3260)
  Bump version to 1.106.0 (260)
  Default to appstore signing for fastlane match
  Clean up secrets in GHA workflows
  Update Onboarding gradients (#3248)
  Wait for UserScripts to be loaded for email protection (#3252)
  Fix UI tests failing in the CI (#3254)
  Fix WKDownloadMock mock (#3258)
  VPN Proxy stop and pixel improvements (#3239)
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants